public class Solution {
    public boolean isUnique(String astr) {
        if(astr.length() > 26)  return false;

        int bitMap = 0;
        for(int i = 0;i < astr.length();i++){
            int x = astr.charAt(i) - 'a';
            if(((bitMap >> x) & 1) == 1)    return false;
            bitMap |= 1 << x;
        }
        return true;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        String astr = "leetcode";
        System.out.println(solution.isUnique(astr));
    }
}
